#pragma comment(linker, "/STACK:10000000")
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <cstdio>
#include <cassert>
#include <string>
#include <cstring>
#define ldb long double
#define LL long long
#define fi first
#define se second
#define fill(a, c) memset(a, c, sizeof(a))
#define sqr(a) ((a) * (a))
#define nextLine() {int c = 0; while((c = getchar()) != 10 && c != EOF);}
#define getBit(mask, k) (((mask) / pw[k]) % pw[1])
#define setBit(mask, k, l) (((mask) / pw[k + 1] * pw[1] + (l)) * pw[k] + ((mask) % pw[k]))
#define debug(a) cerr << #a << " = " << a << " ";
#define debugl(a) cerr << #a << " = " << a << "\n";
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define ff first
#define ss second 
const ldb LDINF = 9128739847123.00;
const ldb eps = 1e-9;
const int inf = 1 << 28;
const ldb pi = fabsl(atan2l(0.0, -1.0));
using namespace std;


int was[3000000];
int a[2000];
int usd, n;
int A, B;

void load()
{
	cin >> A >> B >> n;
}

void solve()
{
    a[0] = 1;
    usd++;
    if (A * a[0] - B * a[0] > 0)
    	was[A * a[0] - B * a[0]] = usd;
    printf("1 ");
    for (int i = 1; i < n; i++)
    {
    	for (a[i] = a[i - 1] + 1; a[i] < 3000000 && was[a[i]] == usd; a[i]++);
    	if (a[i] == 3000000) throw 42;
    	was[a[i]] = usd;
    	for (int j = 0; j <= i; j++)
    	{
    	//	cerr << A * a[j] - B * a[i] << " " << A * a[i] - B * a[j] << " ";
    		if (A * a[j] - B * a[i] > 0 && A * a[j] - B * a[i] <= 3000000)
    			was[A * a[j] - B * a[i]] = usd;
            if (A * a[i] - B * a[j] > 0 && A * a[i] - B * a[j] <= 3000000)
    			was[A * a[i] - B * a[j]] = usd;
    	}
    	//cerr << "\n";
    	printf("%d ", a[i]);
    }
    printf("\n");
}

#define file "a"
int main()
{
	#ifndef ONLINE_JUDGE
		freopen(file".in", "rt", stdin);
		freopen(file".out", "wt", stdout);
	#endif
	int T;
	cin >> T;
	for (int i = 0; i < T; i++)
	{
		load();
		solve();
	}
	return 0;
}
